package com.qf.controller;


import com.qf.bean.AjaxMessage;
import com.qf.entity.Course;
import com.qf.entity.CourseDetailsTeachers;
import com.qf.service.ICourseDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lcx
 * @since 2020-09-03
 */
@RestController
@RequestMapping("/course-details")
public class CourseDetailsController {

    @Autowired
    private ICourseDetailsService courseDetailsService;

    @RequestMapping("/detail")
    public AjaxMessage selectDetail(Course course){
        List<CourseDetailsTeachers> courseDetailsTeachers = courseDetailsService.selectDetail(course);
        if (courseDetailsTeachers == null){
            return new AjaxMessage(1,"未找到结果");
        }
        return new AjaxMessage(0,"",courseDetailsTeachers);
    }
}
